var MakeMyDreamForm = Backbone.View.extend({
    channel: null,
    model: new DreamModel(),
    initialize: function (options) {
        this.channel = options.channel;
        _.bindAll(this, "show", "setModel");

        this.channel.bind("showMakeMyDreamForm", this.show);
        this.channel.bind("hideMakeMyDreamForm", this.hide);

        this.$el.find("#submiteMyDream").click(this.setModel)
    },
    setModel: function () {
        this.model.set({
            experienceId: this.$el.find("#experienceId").val(),
            countryId: this.$el.find("#countryId").val(),
            price: this.$el.find("#price").val(),
            arrival: this.$el.find("#arrival").val(),
            departure: this.$el.find("#departure").val(),
            flexible: this.$el.find("#flexible").val(),
            numPersons: this.$el.find("#numPersons").val(),
            accomodation: this.$el.find("#accomodation").val(),
            meals: this.$el.find("#meals").val(),
            transportation: this.$el.find("#transportation").val(),
            details: this.$el.find("#details").val()
        });
        $("#iWanToR").html($("#iWanTo").val())
        $("#experienceIdR").html($("#experienceId").val())
        $("#countryIdR").html($("#countryId").val())
        $("#priceR").html($("#price").val())
        $("#arrivalR").html($("#arrival").val())
        $("#departureR").html($("#departure").val())
        $("#flexibleR").html($("#flexible").val())
        $("#numPersonsR").html($("#numPersons").val())
        $("#accomodationR").html($("#accomodation").val())
        $("#mealsR").html($("#meals").val())
        $("#transportationR").html($("#transportation").val())
        this.channel.trigger("cHideMakeMyDreamForm");
        $("#viewMyDream").show();

   
    },
    show: function () {
        this.channel.trigger("cHideWelcomeScreen");
        $("#makeMyDreamForm").show()
    },
    hide: function() {
        $("#makeMyDreamForm").hide()
    }

});